from openai import OpenAI
# Set OpenAI's API key and API base to use vLLM's API server.
openai_api_key = "EMPTY"
openai_api_base = "http://0.0.0.0:8000/v1"

client = OpenAI(
    api_key=openai_api_key,
    base_url=openai_api_base,
)

models = client.models.list()
model_id = models.data[0].id


chat_response = client.chat.completions.create(
    model=model_id,
    messages=[
        {"role": "user", "content": "你是谁"},
    ]
)
print("Chat response:", chat_response)
